<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
                <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
                <title></title>
                <link rel="stylesheet" href="http://localhost/shopFrame/Application/Admin/View/Public/Css/bootstrap.min.css" />
                <link rel="stylesheet" href="http://localhost/shopFrame/Application/Admin/View/Public/Css/common.css" />
                <script type='text/javascript' src='http://localhost/shopFrame/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>

                <script type="text/javascript" src="http://localhost/shopFrame/Application/Admin/View/Public/Js/cate.js"></script>
        </head>
        <body>
                <form action='' method="post">
                        <div class="container-fluid">
                                <div class="row-fluid">
                                        <div class="span12">
                                                <table class="table table-bordered table-hover">
                                                        <thead>
                                                                <tr pid="0">
                                                                        <th>
                                                                                分类ID
                                                                        </th>
                                                                        <th>
                                                                                分类名称
                                                                        </th>
                                                                        <th>
                                                                                排序
                                                                        </th>
                                                                        <th>
                                                                                所属类型
                                                                        </th>
                                                                        <th>
                                                                                操作
                                                                        </th>
                                                                </tr>
                                                        </thead>
                                                        <tbody>
                                                                <?php if(is_array($data)){?><?php  foreach($data as $key=>$v){ ?>
                                                                        <tr class="info" pid='<?php echo $v["pid"];?>' cid="<?php echo $v['cid'];?>">
                                                                                <td>
                                                                                        <a href='javascript:;' class="plus"></a><a href='javascript:;' class="minus"></a>
                                                                                        <?php echo $v['cid'];?>
                                                                                </td>
                                                                                <td class='open'><?php echo $v['_name'];?></td>
                                                                                </td>
                                                                                <td>
                                                                                        <?php echo $v['sort'];?>
                                                                                </td>
                                                                                <td>
                                                                                        <?php echo $v['type_tid'];?>
                                                                                </td>
                                                                                <td>
                                                                                        <a href="<?php echo U('add_son',array('pid'=>$v['cid']));?>" class="btn btn-success"><i class="icon-edit icon-white"></i>添加子分类</a>
                                                                                        <a href="<?php echo U('edit',array('cid'=>$v['cid']));?>" class="btn btn-warning"><i class="icon-pencil icon-white"></i>修改</a>
                                                                                        <a href="<?php echo U('del',array('cid'=>$v['cid']));?>" class="btn btn-danger"><i class="icon-trash icon-white"></i>删除</a>
                                                                                </td>
                                                                        </tr>
                                                                <?php }}?>
                                                                <tr pid="0">
                                                                        <td colspan='5' align='center'>
                                                                                <input type="hidden" name='table' value='category' />
                                                                                <form action='' method='post'>
                                                                                <input type="submit" value='排序' class="btn btn-primary"/>
                                                                                </form>
                                                                        </td>
                                                                </tr>
                                                        </tbody>
                                                </table>
                                        </div>
                                </div>
                        </div>
                </form>

                <script type="text/javascript">
                        $(function() {
                                $('.open').toggle(function() {
                                        var cid = $(this).attr('cid');
                                        $('tr[pid=' + cid + ']').fadeIn(600);
                                }, function() {
                                        var cid = $(this).attr('cid');
                                        $('tr[pid=' + cid + ']').fadeOut(600);
                                });
                        });
                </script>
        </body>
</html>